<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta content="initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width" name="viewport" />
<meta content="yes" name="apple-mobile-web-app-capable" />
<meta content="black" name="apple-mobile-web-app-status-bar-style" />
<meta content="telephone=no" name="format-detection" />
<title>无标题文档</title>
<script src="js/jquery.js"></script>

    <#include "public/app/mxcss.ftl">
    <script src="/jquery-2.2.3.min.js"></script>
    <script src="/method.js"></script>
</head>

<body>
<article class="hometop"><a href="javascript:history.back(-1);" class="left"><img src="../images/arrow-left.png"></a> <span>修改交易密码</span> </article>
<article class="usercenter">
    <section class="two">
    	<p>请输入新交易密码</p>
        <section class="userlist">
            <ul>
                <li>
                    <ul>
                        <li class="fl"><input type="password" id="newTradePassword" placeholder="输入新交易密码"></li>
                    </ul>
                </li>
                <li>
                    <ul>
                        <li class="fl"><input type="password" id="checkNewTradePassword" placeholder="重复新交易密码"></li>
                    </ul>
                </li>
			</ul>
		</section>
        <aside class="ml22 mr22 mb22 mt22"> <a href="javascript:addNewTradePassword()" class="btn btn-orange">下一步</a> </aside>
        
    </section>
</article>

<script>
    function addNewTradePassword(){
        var newTradePassword = $("#newTradePassword").val();
        var checkNewTradePassword = $("#checkNewTradePassword").val();
        if(newTradePassword == ""){
            alert("请输入新的交易密码");
            return ;
        }
        if(checkNewTradePassword == ""){
            alert("请再次输入新的交易密码");
            return ;
        }
        if(newTradePassword != checkNewTradePassword){
            alert("两次输入的交易密码不同");
            return ;
        }

        var data = {tradePassword : newTradePassword};
        var url = "/securitycenter/updatetradepassword";

        postReq(url,data,function(result){
            if(result.success){
                location.href="/securitycenter/changetradepass";
            }else{
                alert(result.msg);
            }
        })
    }
</script>
</body>
</html>